﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;

namespace ZhimeiSoft.CharmManager.DOL
{
    /// <summary>
    /// 代办事项
    /// </summary>
    public class DBEntityToDoList : DBEntityBase
    {
        public override string GetTableName()
        {

            return "TODOLIST";
        }

        public DBEntityToDoList()
            : base()
        {
        }
        public DBEntityToDoList(DataRow drRow)
        {
            this.TODOLISTID = Convert.ToInt32(drRow[DBEntityToDoList.FieldName.TODOLISTID]);
            this.TODODECRIPTION = drRow[DBEntityToDoList.FieldName.TODODECRIPTION].ToString();
            this.TODOSTARTTIME = Convert.ToDateTime(drRow[DBEntityToDoList.FieldName.TODOSTARTTIME]);
            this.TODOENDTIME = Convert.ToDateTime(drRow[DBEntityToDoList.FieldName.TODOENDTIME]);
            this.TODOCOMPLETIONRATE = Convert.ToInt32(drRow[DBEntityToDoList.FieldName.TODOCOMPLETIONRATE]);
            this.TODOSTATE = drRow[DBEntityToDoList.FieldName.TODOSTATE].ToString();
            this.TODOMEMO = drRow[DBEntityToDoList.FieldName.TODOMEMO].ToString();
            this.EMPLOYEEID = Convert.ToInt32(drRow[DBEntityToDoList.FieldName.EMPLOYEEID]);
        }
        /// <summary>
        /// 待办事项ID
        /// </summary>
        public int TODOLISTID { get; set; }
        /// <summary>
        /// 待办事项说明
        /// </summary>
        public string TODODECRIPTION { get; set; }
        /// <summary>
        /// 代办事项开始时间
        /// </summary>
        public DateTime TODOSTARTTIME { get; set; }
        /// <summary>
        /// 代办事项结束时间
        /// </summary>
        public DateTime TODOENDTIME { get; set; }
        /// <summary>
        /// 完成率
        /// </summary>
        public int TODOCOMPLETIONRATE { get; set; }
        /// <summary>
        /// 状态 T0N未开始、 T0I进行中、 T0V已完成、 T0T已推迟、
        /// </summary>
        public string TODOSTATE { get; set; }
        /// <summary>
        /// 详细说明
        /// </summary>
        public string TODOMEMO { get; set; }
        /// <summary>
        /// 完成人ID 员工ID
        /// </summary>
        public int EMPLOYEEID { get; set; }
        /// <summary>
        /// 字段名称
        /// </summary>
        public static class FieldName
        {
            /// <summary>
            /// 待办事项ID
            /// </summary>
            public const string TODOLISTID = "TODOLISTID";
            /// <summary>
            /// 待办事项说明
            /// </summary>
            public const string TODODECRIPTION = "TODODECRIPTION";
            /// <summary>
            /// 代办事项开始时间
            /// </summary>
            public const string TODOSTARTTIME = "TODOSTARTTIME";
            /// <summary>
            /// 代办事项结束时间
            /// </summary>
            public const string TODOENDTIME = "TODOENDTIME";
            /// <summary>
            /// 完成率
            /// </summary>
            public const string TODOCOMPLETIONRATE = "TODOCOMPLETIONRATE";
            /// <summary>
            /// 状态 T0N未开始、 T0I进行中、 T0V已完成、 T0T已推迟、
            /// </summary>
            public const string TODOSTATE = "TODOSTATE";
            /// <summary>
            /// 详细说明
            /// </summary>
            public const string TODOMEMO = "TODOMEMO";
            /// <summary>
            /// 完成人ID 员工ID
            /// </summary>
            public const string EMPLOYEEID = "EMPLOYEEID";
        }
        /// <summary>
        /// 状态 T0N未开始、 T0I进行中、 T0V已完成、 T0T已推迟、
        /// </summary>
        public static class ENUM_TODOSTATE
        {
            /// <summary>
            /// T0N未开始
            /// </summary>
            public const string T0N = "T0N";
            /// <summary>
            /// T0I进行中
            /// </summary>
            public const string T0I = "T0I";
            /// <summary>
            /// T0V已完成
            /// </summary>
            public const string T0V = "T0V";
            /// <summary>
            /// T0T已推迟
            /// </summary>
            public const string T0T = "T0T";
            /// <summary>
            /// T0N未开始
            /// </summary>
            public const string T0N_CHINESE = "未开始";
            /// <summary>
            /// T0I进行中
            /// </summary>
            public const string T0I_CHINESE = "进行中";
            /// <summary>
            /// T0V已完成
            /// </summary>
            public const string T0V_CHINESE = "已完成";
            /// <summary>
            /// T0T已推迟
            /// </summary>
            public const string T0T_CHINESE = "已推迟";
            /// <summary>
            /// 根据枚举值返回中文
            /// </summary>
            /// <param name="cState">枚举值</param>
            /// <returns>返回中文</returns>
            public static string EnumStrToChineseStr(string cState)
            {
                string[] serchStr = new string[] { T0N, T0I, T0V, T0T };
                string[] sReturnStr = new string[] { T0N_CHINESE, T0I_CHINESE, T0V_CHINESE, T0T_CHINESE};
                return DBEntityBase.GetStrReturnStr(cState, serchStr, sReturnStr);
            }
            /// <summary>
            /// 根据中文返回枚举值
            /// </summary>
            /// <param name="chineseStr">中文</param>
            /// <returns>返回枚举字符串</returns>
            public static string ChineseStrToEnumStr(string chineseStr)
            {
                string[] serchStr = new string[] { T0N_CHINESE, T0I_CHINESE, T0V_CHINESE, T0T_CHINESE };
                string[] sReturnStr = new string[] { T0N, T0I, T0V, T0T };
                return DBEntityBase.GetStrReturnStr(chineseStr, serchStr, sReturnStr);
            }
        }
    }
}
